package com.han.cloud.controller;

import com.han.cloud.dto.TradeDTO;
import com.han.cloud.dto.WrapperResponse;
import com.han.cloud.service.FeignClientPaymentService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author hanky
 * @date 2021/11/11
 */
@RestController
@Slf4j
public class FeignOrderController {

    @Resource
    private FeignClientPaymentService feignClientPaymentService;

    @GetMapping("/feign/order/getTrade")
    public WrapperResponse<TradeDTO> getTrade(@RequestParam("id") String id){
        WrapperResponse<TradeDTO> res = feignClientPaymentService.getTrade(id);
        return res;
    }
}
